#include <iostream>
#include <assert.h>
using namespace std;




template < typename T >
class my_vector
{
public:
	my_vector(){ m_pData = NULL; m_nSize = 0;}
	my_vector( int n ){ m_pData = new T[n]; m_nSize = n;}
	
	~my_vector(){ if ( m_pData ){ delete [] m_pData;} }

	int size() const { return m_nSize;}

	friend ostream& operator<<( ostream& os,  my_vector& vec)
	{

	}

	T& operator[](int i)
	{ 
		assert( i>=0 && i < m_nSize );
		return m_pData[i];
	}

private:
	T* m_pData;
	int m_nSize;
};


template < typename T >
ostream& operator<<( ostream& os,  my_vector<T>& vec)
{
	for ( int i = 0; i < vec.size(); i++) 
		os << vec[i] <<"  ";
	return os;
}

int main()
{
	my_vector<int> vec(10);
	for ( int i =0; i < 10 ;i++)
	{
		vec[i]=i;
	}
	
	cout << vec << endl;;

	return 0;
}